package com.lwphk.easydocs.util;

public class SlashRemoverUtil {

	public static String removeSlashes(String input) {
        String output = input;
        
        // 移除开头和结尾的斜杠
        if (output.startsWith("/")) {
            output = output.substring(1);
        }
        if (output.endsWith("/")) {
            output = output.substring(0, output.length() - 1);
        }
        
        // 替换中间连续出现两个以上的斜杠为一个斜杠
        output = output.replaceAll("/{2,}", "/");
        
        return output;
    }
}
